package com.qidian.mes.md.mapper;

import com.qidian.mes.pojo.MaterialSupporter;
import com.qidian.mes.pojo.MdSupport;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @Author: 小可怎么都睡不够
 * @Description:
 * @Time: 2024-04-08 22:32
 **/
public interface SupporterMapper {

    // 增加一个供应商
    void addSupporter(MdSupport supporter);

    // 根据供应商ID删除供应商
    void deleteSupporterById(Long id);

    // 更新供应商信息
    void updateSupporter(MdSupport supporter);

    // 根据供应商ID查询供应商
    MdSupport findSupporterById(Long id);

    // 查询所有供应商
    List<MdSupport> findAllSupporters();
    List<MdSupport> findSupportersByCriteria(@Param("keyword") String keyword,@Param("level") Integer level,
                                             @Param("score") Integer score, @Param("offset") int offset,
                                             @Param("pageSize") int pageSize);

    //获取总条数
    Integer getCount();

    //根据物料ID查询供应商
    List<MdSupport> findSupporterByMat(@Param("Supporter") MdSupport supporter, @Param("matId") Integer matId, @Param("offset") Integer offset, @Param("pageSize") Integer pageSize);

    void insertMatSup(MaterialSupporter materialSupporter);

    void deleteByIdSupport(@Param("idSupport") Integer idSupport ,@Param("idMat") Integer idMat);

    void updateSupportCount(@Param("idSupport") Integer idSupport ,@Param("idMat") Integer idMat,@Param("count") Double count);
}
